package com.stefan.sort;

import java.util.Arrays;

public class C {
    public static void main(String[] args) {
        int[] data = {7,9,3,2,4,6,0,5,1,8};
        System.out.println("yu:"+Arrays.toString(data));
        for (int i =0;i< data.length-1;i++) { //lun ci
            int p = i;
            for (int j=i+1;j<data.length;j++) {
                if (data[p]>data[j]) {
                    p = j;
                }
            }
            //switch
            int temp = data[i];
            data[i] = data[p];
            data[p] = temp;
            System.out.println(i+"伦"+ Arrays.toString(data));
        }
        System.out.println(Arrays.toString(data));
    }
}
